package com.taobao.txc.a.b;

import java.util.concurrent.CountDownLatch;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

public class b
{
  private u a;
  private long b;
  private long c = System.currentTimeMillis();
  private volatile Object d;
  private static final Object e = new Object();
  private final CountDownLatch f = new CountDownLatch(1);
  
  public boolean a()
  {
    return System.currentTimeMillis() - this.c > this.b;
  }
  
  public Object a(long paramLong, TimeUnit paramTimeUnit)
  {
    boolean bool = this.f.await(paramLong, paramTimeUnit);
    if (!bool) {
      throw new TimeoutException("cost " + (System.currentTimeMillis() - this.c) + " ms");
    }
    if ((this.d instanceof RuntimeException)) {
      throw ((RuntimeException)this.d);
    }
    if ((this.d instanceof Throwable)) {
      throw new RuntimeException((Throwable)this.d);
    }
    return this.d;
  }
  
  public void a(Object paramObject)
  {
    this.d = (paramObject == null ? e : paramObject);
    this.f.countDown();
  }
  
  public u b()
  {
    return this.a;
  }
  
  public void a(u paramu)
  {
    this.a = paramu;
  }
  
  public void a(long paramLong)
  {
    this.b = paramLong;
  }
}


/* Location:           C:\Users\ibm\Downloads\txc-yun-sample (1)\txc-yun-sample\lib\txc-client-2.0.72.jar
 * Qualified Name:     com.taobao.txc.a.b.b
 * JD-Core Version:    0.7.0.1
 */